Optimal. Leaf size=76 \[ -\frac {2 i a \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{(c-i d)^{3/2} f}-\frac {2 a}{(i c+d) f \sqrt {c+d \tan (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3610, 3618, 65,
214} \begin {gather*} -\frac {2 a}{f (d+i c) \sqrt {c+d \tan (e+f x)}}-\frac {2 i a \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f (c-i d)^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3610
Rule 3618
Rubi steps
\begin {align*} \int \frac {a+i a \tan (e+f x)}{(c+d \tan (e+f x))^{3/2}} \, dx &=-\frac {2 a}{(i c+d) f \sqrt {c+d \tan (e+f x)}}+\frac {\int \frac {a (c+i d)+a (i c-d) \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{c^2+d^2}\\ &=-\frac {2 a}{(i c+d) f \sqrt {c+d \tan (e+f x)}}-\frac {\left (a^2 (c+i d)\right ) \text {Subst}\left (\int \frac {1}{\left (a^2 (i c-d)^2+a (c+i d) x\right ) \sqrt {c+\frac {d x}{a (i c-d)}}} \, dx,x,a (i c-d) \tan (e+f x)\right )}{(i c+d) f}\\ &=-\frac {2 a}{(i c+d) f \sqrt {c+d \tan (e+f x)}}-\frac {\left (2 a^3 (c+i d)^2\right ) \text {Subst}\left (\int \frac {1}{a^2 (i c-d)^2-\frac {a^2 c (i c-d) (c+i d)}{d}+\frac {a^2 (i c-d) (c+i d) x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{(c-i d) d f}\\ &=-\frac {2 i a \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{(c-i d)^{3/2} f}-\frac {2 a}{(i c+d) f \sqrt {c+d \tan (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(158\) vs. \(2(76)=152\).
time = 2.62, size = 158, normalized size = 2.08 \begin {gather*} \frac {2 i a e^{-i e} (\cos (e)+i \sin (e)) \left (-\tanh ^{-1}\left (\frac {\sqrt {c-\frac {i d \left (-1+e^{2 i (e+f x)}\right )}{1+e^{2 i (e+f x)}}}}{\sqrt {c-i d}}\right ) (c \cos (e+f x)+d \sin (e+f x))+\sqrt {c-i d} \cos (e+f x) \sqrt {c+d \tan (e+f x)}\right )}{(c-i d)^{3/2} f (c \cos (e+f x)+d \sin (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 1014 vs. \(2 (64 ) = 128\).
time = 0.31, size = 1015, normalized size = 13.36
method | result | size |
derivativedivides | \(\frac {a \left (\frac {\frac {\frac {\left (i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c +i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{2}-\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d -2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d \right ) \ln \left (d \tan \left (f x +e \right )+c -\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-2 i c^{2} \sqrt {c^{2}+d^{2}}+2 i d^{2} \sqrt {c^{2}+d^{2}}-2 i c^{3}+2 i c \,d^{2}+4 c d \sqrt {c^{2}+d^{2}}+4 c^{2} d +\frac {\left (i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c +i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{2}-\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d -2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}-\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{2 \left (\sqrt {c^{2}+d^{2}}+c \right ) \sqrt {c^{2}+d^{2}}}+\frac {\frac {\left (-i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}+i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{2}+\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d +2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-2 i c^{2} \sqrt {c^{2}+d^{2}}+2 i d^{2} \sqrt {c^{2}+d^{2}}-2 i c^{3}+2 i c \,d^{2}+4 c d \sqrt {c^{2}+d^{2}}+4 c^{2} d -\frac {\left (-i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}+i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{2}+\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d +2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{2 \left (\sqrt {c^{2}+d^{2}}+c \right ) \sqrt {c^{2}+d^{2}}}}{c^{2}+d^{2}}-\frac {2 \left (-i c +d \right )}{\left (c^{2}+d^{2}\right ) \sqrt {c +d \tan \left (f x +e \right )}}\right )}{f}\) | \(1015\) |
default | \(\frac {a \left (\frac {\frac {\frac {\left (i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c +i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{2}-\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d -2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d \right ) \ln \left (d \tan \left (f x +e \right )+c -\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-2 i c^{2} \sqrt {c^{2}+d^{2}}+2 i d^{2} \sqrt {c^{2}+d^{2}}-2 i c^{3}+2 i c \,d^{2}+4 c d \sqrt {c^{2}+d^{2}}+4 c^{2} d +\frac {\left (i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c +i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}-i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{2}-\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d -2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}-\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{2 \left (\sqrt {c^{2}+d^{2}}+c \right ) \sqrt {c^{2}+d^{2}}}+\frac {\frac {\left (-i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}+i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{2}+\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d +2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d \right ) \ln \left (d \tan \left (f x +e \right )+c +\sqrt {c +d \tan \left (f x +e \right )}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}+\sqrt {c^{2}+d^{2}}\right )}{2}+\frac {2 \left (-2 i c^{2} \sqrt {c^{2}+d^{2}}+2 i d^{2} \sqrt {c^{2}+d^{2}}-2 i c^{3}+2 i c \,d^{2}+4 c d \sqrt {c^{2}+d^{2}}+4 c^{2} d -\frac {\left (-i \sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c -i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c^{2}+i \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d^{2}+\sqrt {c^{2}+d^{2}}\, \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, d +2 \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}\, c d \right ) \sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{2}\right ) \arctan \left (\frac {2 \sqrt {c +d \tan \left (f x +e \right )}+\sqrt {2 \sqrt {c^{2}+d^{2}}+2 c}}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}\right )}{\sqrt {2 \sqrt {c^{2}+d^{2}}-2 c}}}{2 \left (\sqrt {c^{2}+d^{2}}+c \right ) \sqrt {c^{2}+d^{2}}}}{c^{2}+d^{2}}-\frac {2 \left (-i c +d \right )}{\left (c^{2}+d^{2}\right ) \sqrt {c +d \tan \left (f x +e \right )}}\right )}{f}\) | \(1015\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 550 vs. \(2 (62) = 124\).
time = 1.00, size = 550, normalized size = 7.24 \begin {gather*} \frac {{\left ({\left (c^{2} - 2 i \, c d - d^{2}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (c^{2} + d^{2}\right )} f\right )} \sqrt {\frac {4 i \, a^{2}}{{\left (-i \, c^{3} - 3 \, c^{2} d + 3 i \, c d^{2} + d^{3}\right )} f^{2}}} \log \left (\frac {{\left (2 \, a c + {\left ({\left (i \, c^{2} + 2 \, c d - i \, d^{2}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, c^{2} + 2 \, c d - i \, d^{2}\right )} f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {4 i \, a^{2}}{{\left (-i \, c^{3} - 3 \, c^{2} d + 3 i \, c d^{2} + d^{3}\right )} f^{2}}} + 2 \, {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{a}\right ) - {\left ({\left (c^{2} - 2 i \, c d - d^{2}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (c^{2} + d^{2}\right )} f\right )} \sqrt {\frac {4 i \, a^{2}}{{\left (-i \, c^{3} - 3 \, c^{2} d + 3 i \, c d^{2} + d^{3}\right )} f^{2}}} \log \left (\frac {{\left (2 \, a c + {\left ({\left (-i \, c^{2} - 2 \, c d + i \, d^{2}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, c^{2} - 2 \, c d + i \, d^{2}\right )} f\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}} \sqrt {\frac {4 i \, a^{2}}{{\left (-i \, c^{3} - 3 \, c^{2} d + 3 i \, c d^{2} + d^{3}\right )} f^{2}}} + 2 \, {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} e^{\left (-2 i \, f x - 2 i \, e\right )}}{a}\right ) + 8 \, {\left (i \, a e^{\left (2 i \, f x + 2 i \, e\right )} + i \, a\right )} \sqrt {\frac {{\left (c - i \, d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + c + i \, d}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}}}{4 \, {\left ({\left (c^{2} - 2 i \, c d - d^{2}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (c^{2} + d^{2}\right )} f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} i a \left (\int \left (- \frac {i}{c \sqrt {c + d \tan {\left (e + f x \right )}} + d \sqrt {c + d \tan {\left (e + f x \right )}} \tan {\left (e + f x \right )}}\right )\, dx + \int \frac {\tan {\left (e + f x \right )}}{c \sqrt {c + d \tan {\left (e + f x \right )}} + d \sqrt {c + d \tan {\left (e + f x \right )}} \tan {\left (e + f x \right )}}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 192 vs. \(2 (62) = 124\).
time = 0.64, size = 192, normalized size = 2.53 \begin {gather*} -2 \, a {\left (\frac {1}{{\left (i \, c f + d f\right )} \sqrt {d \tan \left (f x + e\right ) + c}} - \frac {2 i \, \arctan \left (\frac {2 \, {\left (\sqrt {d \tan \left (f x + e\right ) + c} c - \sqrt {c^{2} + d^{2}} \sqrt {d \tan \left (f x + e\right ) + c}\right )}}{c \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} - i \, \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} d - \sqrt {c^{2} + d^{2}} \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}}}\right )}{{\left (c f - i \, d f\right )} \sqrt {-2 \, c + 2 \, \sqrt {c^{2} + d^{2}}} {\left (-\frac {i \, d}{c - \sqrt {c^{2} + d^{2}}} + 1\right )}}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 14.43, size = 2500, normalized size = 32.89 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________